package org.sean.framework.code;

import org.sean.framework.bean.BaseResult;

/**
 * 状态码
 */
public class StatusCode {
    /**
     * 启动异常
     */
    public static final int ERROR_SERVER_STARTING = -2;
    /**
     * 未知错误
     */
    public static final int ERROR_UNKNOW = -1;
    /**
     * 成功
     */
    public static final int SUCCESS = BaseResult.CODE_SUCCESS;
    /**
     * 未登录
     */
    public static final int ERROR_NOT_LOGINED = 1;
    /**
     * 数据异常
     */
    public static final int ERROR_DATA_INVALID = 2;
    /**
     * 权限验证失败
     */
    public static final int ERROR_AUTHORITY_FAILED = 3;
    /**
     * 内存异常
     */
    public static final int ERROR_MEMORY = 4;
    /**
     * 数据校验失败
     */
    public static final int ERROR_VERIFY_FAILED = 5;
    /**
     * 登录超时
     */
    public static final int ERROR_LOGIN_TIMEOUT = 6;
    /**
     * 不支持此操作
     */
    public static final int ERROR_NOT_SUPPORTED = 10;
    /**
     * 编码错误
     */
    public static final int ERROR_ENCODER = 11;
    /**
     * 解码错误
     */
    public static final int ERROR_DECODER = 12;
    /**
     * 操作超时
     */
    public static final int ERROR_TIMEOUT = 20;
    /**
     * 参数错误
     */
    public static final int ERROR_PARAMS = 1100;

    // 200 - 599  不可使用
    /**
     * JSON 校验失败
     */
    public static final int ERROR_PARAMS_NOT_JSON = 1101;
    /**
     * 查不到指定数据
     */
    public static final int ERROR_NOT_EXIST = 1151;
    /**
     * 数据已存在,不可重复
     */
    public static final int ERROR_EXIST = 1152;
    /**
     * 数据访问错误
     */
    public static final int ERROR_DATA_ACCESS = 1199;
    /**
     * 数据库错误
     */
    public static final int ERROR_DATABASE = 1200;
    /**
     * 数据库操作失败
     */
    public static final int ERROR_DATABASE_OPT_FAILED = 1201;
    /**
     * REDIS 异常
     */
    public static final int ERROR_REDIS = 1300;
    /**
     * 网络异常
     */
    public static final int ERROR_NET = 1400;
    /**
     * Kafka 连接
     */
    public static final int ERROR_KAFKA = 1500;
    /**
     * 签名校验失败
     */
    public static final int ERROR_SIGN = 1600;
    /**
     * Header 校验失败
     */
    public static final int ERROR_HEADER = 1620;
    /**
     * 同步方法异常
     */
    public static final int ERROR_SYNC = 1700;
    /**
     * 同步方法超时
     */
    public static final int ERROR_SYNC_TIMEOUT = 1701;
    /**
     * 定时任务异常
     */
    public static final int ERROR_SCHEDULE_TASK = 1710;
    /**
     * 调用微服务异常
     */
    public static final int ERROR_ACCESS_MS = 1720;
    /**
     * 邮件通道错误
     */
    public static final int ERROR_EMAIL = 1800;

    //------------- 第三方错误使用 1800 - 1999 --------------------
    /**
     * 短信通道错误
     */
    public static final int ERROR_SMS = 1805;
    /**
     * 融云错误
     */
    public static final int ERROR_RONG_CLOUD = 1810;
    /**
     * 阿里云OSS
     */
    public static final int ERROR_OSS_ALIYUN = 1815;
    /**
     * 操作取消
     */
    public static final int ERROR_CANCEL = 20100;

    //---------------------- 业务错误使用20000 -30000  ------------------------
    private StatusCode() {
    }
}
